<h2 class='header'>Nominations - <?php echo ucfirst($url[1]); ?></h2>
<div class='contentBody'>
	<?php
		if($url[1]=='individual') echo "<p>This page should be used mostly for stats purposes. It will show you nomination information by individual users.</p>";
		elseif($url[1]=='votes') echo "<p>This page should be used mostly for stats purposes. It will show you voting information by individual users.</p>";
		else {
			echo "<p>This page will display all user nominations grouped together under their specific category.</p>";
			if($_SESSION['access']!='0') echo "<p id='error_msg'>You have a maximum of 10 votes to pick the finalists for the SA Blog Awards.</p>";
		}
	?>
	<form name='searchform' id='searchform' class='funcSubmitSearch' action='<?php echo HTTP_SERVER.ADMIN_DIR.$url[0].'/'.$url[1]; ?>' method='post'>
		<p>
			<b>Search: </b><input id='search' name='search' value='<?php echo $_SESSION['nomination_search']; ?>' />
			<select id='searchfield' name='searchfield'>
				<option value='user.email' <?php if ($_SESSION['nomination_field'] == "user.email") echo "selected='selected'"; ?>>User Email</option>
				<option value='contestant.url' <?php if ($_SESSION['nomination_field'] == "contestant.url") echo "selected='selected'"; ?>>Contestant URL</option>
			</select>
			<input type='submit' id='search_submit' name='search_submit' class='button' value='Search' />
			<a href='<?php echo HTTP_SERVER.ADMIN_DIR.$url[0].'/'.$url[1].'?reset=1'; ?>' class='funcResetSearchForm'>Reset</a>
			&nbsp;<span id='search-loading' class='hideme spinner'> </span>
		</p>
		
		<p><b>Filters: </b><br />
			<select id='filtercategory' name='filtercategory' onchange="return do_search('');">
			<?php 
				//only admin has access to filter all categories
				if($_SESSION['access']=='0') echo "<option value=''>Filter Category</option>";
				$db->Query("SELECT id, name FROM category;");
				while($db->getRow()) {
					if(in_array($db->access['id'], explode(',',$_SESSION['access'])) || $_SESSION['access']=='0')
						echo "<option value='".$db->access['id']."' "; if($_SESSION['filtercategory']==$db->access['id']) echo "selected='selected'"; echo ">".$db->access['name']."</option>";
				}
			?>
			</select>
			<?php
				if($url[1]=='individual' || $url[1]=='votes') {
					//can only confirm individual user nominations or votes, not grouped nominations
					echo "<select id='filterconfirmed' name='filterconfirmed' onchange=\"return do_search('');\">
									<option value=''>Filter Confirmed</option>
									<option value='1' "; if($_SESSION['filterconfirmed']=='1') echo "selected='selected'"; echo ">Yes</option>
									<option value='0' "; if($_SESSION['filterconfirmed']=='0') echo "selected='selected'"; echo ">No</option>
								</select>";
				} else echo "<input type='hidden' id='filterconfirmed' name='filterconfirmed' value='' />";
			?>
		</p>
	</form>
	<div id='nomination_results' name='nomination_results'><?php echo $results; ?></div>
</div>